package com.zuowei.ycy.user.ui.mine;


import android.widget.TextView;

import com.and.yzy.frame.util.RetrofitUtils;
import com.zuowei.ycy.R;
import com.zuowei.ycy.user.http.Article;
import com.zuowei.ycy.ui.BaseToolbarAty;
import com.zuowei.ycy.user.util.AppJsonUtil;

import butterknife.Bind;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Response;

/**
 * 关于我们
 */
public class MineAboutUsAty extends BaseToolbarAty {
    @Bind(R.id.tv_name)
    TextView mTvName;
    @Bind(R.id.tv_banquan)
    TextView mTvBanquan;

    @Override
    public int getLayoutId() {
        return R.layout.mine_about_us_layout;
    }

    @Override
    public void initData() {
        mToolbar.setTitle("关于我们");
    }

    @Override
    public boolean setIsInitRequestData() {
        return true;
    }

    @Override
    public void requestData() {

        showLoadingContentDialog();
        doHttp(RetrofitUtils.createApi(Article.class).aboutUs(), 1);
    }

    @Override
    public void onSuccess(String result, Call<ResponseBody> call, Response<ResponseBody> response, int what) {

        String name= AppJsonUtil.getString(result,"company_name");
        String banquan= AppJsonUtil.getString(result,"copyright");

        mTvName.setText(name);
        mTvBanquan.setText(banquan);




        super.onSuccess(result, call, response, what);
    }

}
